package world.location;

import java.util.ArrayList;

import world.location.engine.CountryFactory;

public class Continent {
	
	/*
	 * Continent
	 */
	
	//Attributs
	protected String name;
	protected Continent continent;
	protected ArrayList<Country> countries;
	
	//Constructor
	public Continent(String name){
		this.name = name;
		
		CountryFactory.generateCountries(this);
		
		controle();
	}
	
	//Methods
	public int getNumberCountries(){
		return countries.size();
	}
	
	/*
	 * return code : 1-4 : warning, 5-10 : error
	 */
	public int controle(){
		
		// Successful city creation
		if (CountryFactory.numberOfCountries(this) != countries.size()) {
			System.out.println("City Creation issue !" + countries.size() + " / " + CountryFactory.numberOfCountries(this));
			return 1;
		}
		
		return 0;
	}
	
	public String getName(){
		return this.name;
	}

}
